<template>
  <div>
    <!-- 头部 -->
    <van-nav-bar title="错题记录" left-text="返回" left-arrow @click-left="onClickLeft">
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>

    <!-- 下拉菜单 -->
    <van-dropdown-menu>
      <van-dropdown-item title="类型不限">
        <van-cell
          v-for="(item,index) in list"
          :key="item"
          :class="{isShow:active===index}"
          :title="item"
          @click="change1(index)"
        />
      </van-dropdown-item>
    <van-dropdown-item title="巩固全部错题" disabled> 
    <!-- <van-cell v-for='(item,index) in list2' :key='item' :class='{isShow:active===index}' :title="item" @click='change2(index)'/> -->
     </van-dropdown-item>
      <van-dropdown-item title="移除错题" @confirm="confirmSelection"></van-dropdown-item>
    </van-dropdown-menu>


  <!-- <div class="box">
    <dix>
      <select name="类型不限" id="">
        <option value="类型不限">类型不限</option>
        <option value="全部">全部</option>
        <option value="套卷练习">套卷练习</option>
        <option value="考点专练">考点专练</option>
        <option value="仿真模考">仿真模考</option>
      </select>
    </dix>
    <dix></dix>
    <dix></dix>
  </div> -->
   
    <div class="img" v-if="!show">
      <van-empty image="error" description="暂无错题记录" />
    </div>
  </div>
</template>

<script>
import {cyjwrong} from '../../utils/http'
export default {
  data() {
    return {
      active: 0,
      list: ["全部", "套卷练习", "考点专练", "仿真模考"],
      show: false
    };
  },
  created() {},
  mounted() {
      this.getWrong()
  },
  methods: {
      //获取移除错题
      async getWrong(id){
          const res = await cyjwrong(id)
          console.log(res)
      },
    onClickLeft() {
      this.$router.push("/exercise");
    },
    change1(index) {
      this.active = index;
    },
    confirmSelection() {
      Dialog.confirm({
        title: "标题",
        message: "弹窗内容"
      })
        .then(() => {
          // on confirm
        })
        .catch(() => {
          // on cancel
        });
    }
  }
};
</script>

<style scoped>
.isShow {
  color: orange;
}
</style>
